﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Device.Location;
using System.Threading;

namespace GPSEmulator
{
    class Program
    {




        static void Main(string[] args)
        {
            var myGPS = new GPSEmulator();
            myGPS.PositionChanged += new EventHandler<GeoPositionChangedEventArgs<GeoCoordinate>>(myGPS_PositionChanged);
            myGPS.StatusChanged += new EventHandler<GeoPositionStatusChangedEventArgs>(myGPS_StatusChanged);
            Console.WriteLine("hy now I will start");
            myGPS.Start();
            Thread.Sleep(10000);
            myGPS.Stop();
            Console.WriteLine("bye");
        }

        static void myGPS_StatusChanged(object sender, GeoPositionStatusChangedEventArgs e)
        {
            Console.WriteLine("GPSEmulator state is " + e.Status);
        }

        static void myGPS_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
        {
            Console.WriteLine("at " + e.Position.Timestamp + " i'm in " + e.Position.Location.Latitude + "; " + e.Position.Location.Longitude);
        }
    }
}
